<!--  -->
<template>
          <el-scrollbar>
            <!-- 不默认展开 -->
            <el-menu :default-openeds="['2']" @select="handleSelect">
              <el-sub-menu index="1">
                <template #title>
                  <el-badge :is-dot="true" class="item" style="margin-right: 1px;">
                    <!-- 1 -->
                  </el-badge>
                  <el-icon><message /></el-icon>消息
                </template>
                <el-menu-item-group>
                  <template #title>Group 1</template>
                  <router-link to="messages"><el-menu-item index="1-1">
                    <el-badge :value="999" class="item">&nbsp;</el-badge>
                    回复我的
                  </el-menu-item></router-link>
                  <router-link to="messages"><el-menu-item index="1-2">
                    <el-badge :value="19" class="item">&nbsp;</el-badge>
                    @我的</el-menu-item></router-link>
                  <router-link to="messages"><el-menu-item index="1-3">
                    <el-badge :value="999" class="item">&nbsp;</el-badge>
                    收到的赞</el-menu-item></router-link>
                  <router-link to="messages"><el-menu-item index="1-4">
                    <el-badge :value="12" class="item">&nbsp;</el-badge>
                    系统消息</el-menu-item></router-link>
                </el-menu-item-group>
              </el-sub-menu>
              <el-sub-menu index="2">
                <template #title>
                  <el-icon><Menu /></el-icon>菜单
                </template>
                <el-menu-item-group>
                  <template #title>Group 1</template>
                  <el-menu-item index="2-1">社区</el-menu-item>
                  <el-menu-item index="2-2">首页</el-menu-item>
                </el-menu-item-group>
                <el-menu-item-group title="Group 2" v-if="this.$store.state.user.isAdmin === '0'">
                  <el-menu-item index="2-3">后台管理</el-menu-item>
                </el-menu-item-group>
              </el-sub-menu>
              <el-sub-menu index="3">
                <template #title>
                  <el-icon><setting /></el-icon>我的
                </template>
                <el-menu-item-group>
                  <template #title>Group 1</template>
                  <router-link :to="'mine?id='+this.$store.state.user.u_id"><el-menu-item index="3-1">管理作品</el-menu-item></router-link>
                  <el-menu-item index="3-2">浏览记录</el-menu-item>
                </el-menu-item-group>
                <el-sub-menu index="3-3">
                  <template #title>我的关注</template>
                  <el-menu-item index="3-3-1">关注的用户</el-menu-item>
                  <el-menu-item index="3-3-2">收藏的帖子</el-menu-item>
                </el-sub-menu>
              </el-sub-menu>
            </el-menu>
          </el-scrollbar>
</template>

<script>
export default {
  name: 'AsideLeft',
  components: {},
  props: {},
  data() {
    return {}
  },
  computed: {},
  watch: {},
  methods: {
    handleSelect(key){
      console.log(key);
      this.$emit('handleSelect',key)
    }
  },
  created() {},
  mounted() {}
}
</script>

<style scoped>
a{
  text-decoration: none;
  }
</style>
